<template>
  <view class="my-profile">
	  <!-- 头部区域 -->
    <view class="header">
      <text class="title" style="font-size: 30px; color: #1d3ca7;">我的</text>
    </view>
    <!-- 用户信息区域 -->
    <view class="user-info" @click="gotoxinxi">
      <image class="avatar" src="https://placehold.co/40x40" alt="用户头像"></image>
	  <view>
      <text class="username">****</text>
	  <image src="../../static/images/phone.png" style="width: 20rpx; height: 20rpx;"></image>
      <text class="phone">13453400987</text>
	  </view>
    </view>

    <!-- 等级信息区域 -->
    <view class="level-info">
		<image src="../../static/images/zuanshi.png" style="width: 30rpx; height: 30rpx; margin-left: 20rpx;"></image>
      <view class="level" style="margin-left: 20rpx;">钻石级</view>
      <text class="score" style="margin-left: 330rpx;">等级分18892.00</text>
    </view>

    <!-- 功能快捷入口 -->
    <view class="shortcut-menu">
      <uni-grid :column="4" :showBorder="false">
        <uni-grid-item v-for="(item, index) in shortcutItems" :key="index">
          <uni-icons :type="item.icon" size="30"></uni-icons>
          <text>{{ item.text }}</text>
        </uni-grid-item>
      </uni-grid>
    </view>

    <!-- 企业认证和其他选项 -->
    <view class="other-options">
      <uni-list>
      	<uni-list-item style="height: 40px;"></uni-list-item>
      	<uni-list-item title="企业认证" thumb="../../static/images/qiyerenzehng.png" thumb-size="sm"
      		rightText="未认证" showArrow></uni-list-item>
      	<uni-list-item title="邀请好友" thumb="../../static/images/yaoqinghaoyou.png"
      		thumb-size="sm" showArrow></uni-list-item>
      	<uni-list-item title="设置" thumb="../../static/images/shezhi.png" thumb-size="sm" showArrow></uni-list-item>
      	<uni-list-item title="常见问题" thumb="../../static/images/question.png" thumb-size="sm" showArrow></uni-list-item>
      	<uni-list-item title="客服电话" thumb="../../static/images/kefu.png" thumb-size="sm"
      		rightText="工作时间 10:00-19:00" showArrow></uni-list-item>
      </uni-list>
    </view>
  </view>
</template>

<script setup>
import { ref } from 'vue';


// 跳转到实名认证页面
const gotoxinxi = () => {
  uni.navigateTo({
	  url: '/pages/my/pageinfo/xinxi'
  });
};
const shortcutItems = ref([
  { icon: 'contact', text: '我的账户' },
  { icon: 'wallet', text: '我的发票' },
  { icon: 'map', text: '结算凭证' },
  { icon: 'location', text: '地址簿' },
  { icon: 'mail-open', text: '合同管理' },
  { icon: 'shop', text: '货源大厅' }
]);
</script>

<style scoped>
.my-profile {
  padding: 10px;
}

.user-info {
  background-color: #002fa7;
  border-radius: 10px;
  color: white;
  padding: 15px;
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.user-info .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}

.user-info .username {
  font-size: 16px;
  margin-right: 10px;
  display: flex;
  justify-content: space-between;
}

.user-info .phone {
  font-size: 14px;
}

.level-info {
  background-color: #ffdc2e;
  border-radius: 10px;
  color: white;
  padding: 10px;
  display: flex;
  /* justify-content: space-between; */
  align-items: center;
  margin-top: 10px;
}

.level-info .level {
  font-size: 16px;
  
}

.level-info .score {
  font-size: 14px;
}

.shortcut-menu {
  height: 20vh;
  margin-top: 20px;
  background-color: #ffffff;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #eeeeee;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.shortcut-menu uni-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  
}

.shortcut-menu uni-grid-item text {
  margin-top: 5px;
  font-size: 14px;
}

.other-options {
  margin-top: 20rpx;
  background-color: #ffffff;
  border-radius: 10px;
  /* padding: 20rpx; */
  border: 1px solid #eeeeee;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  /* display: flex; */
}
</style>